<template>
  <img alt="Vue logo" src="./assets/logo.png"/>
  <p>
    <button @click="show">{{ isShowDemo ? "卸载组件" : "挂载组件" }}</button>
  </p>
  <demo v-if="isShowDemo"/>
</template>

<script>
import {ref} from 'vue'
import Demo from './components/Demo.vue'

export default {
  name: 'App',
  components: {
    Demo
  },
  setup() {
    const isShowDemo = ref(true)

    const show = () => {
      isShowDemo.value = !isShowDemo.value
    }

    return {
      isShowDemo,
      show
    }
  }
}
</script>
